const router = require('.')
const query = require('../utils/query')

module.exports = (router) => {

  // 种类
  router.get('/kinds', (req, res, next) => {
    query('select * from ').then(result => {
      res.render('kinds', {result})
    });
  })
    .get('/kinds/:id', async (req, res, next) => {
      let id = req.params.id;
      let {page = 1} = req.query
      let maxLengths = 20;
      let index = (page -1) * maxLengths;

      // 计算总页数
      let allResults = await  query(`select * from -- where --- = ${id}`)
    });

}